package com.example.mall.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.mall.util.CodeGenerateUtils;

import java.io.Serializable;

/**
 * <p>
 * 优惠券领取记录表
 * </p>
 *
 * @author whale
 * @since 2025-05-06
 */
@TableName("tb_coupon_receive")
public class CouponReceive extends Model<CouponReceive> {

    private static final long serialVersionUID = 1L;

    /**
     * 领取记录唯一标识
     */
    @TableId("receive_id")
    private Long receiveId;
    /**
     * 用户id
     */
    @TableField("user_id")
    private Long userId;
    /**
     * 模板id
     */
    @TableField("template_id")
    private Long templateId;
    /**
     * 优惠券编码
     */
    @TableField("coupon_code")
    private String couponCode;
    /**
     * 领取时间
     */
    @TableField("receive_time")
    private Date receiveTime;
    /**
     * 状态（0-已领取未使用，1-已使用，-1-已过期）
     */
    private Integer status;
    /**
     * 创建时间
     */
    @TableField("create_date")
    private Date createDate;
    /**
     * 更新时间
     */
    @TableField("update_date")
    private Date updateDate;

    public CouponReceive() {
        this.receiveId = Long.valueOf(CodeGenerateUtils.generateUniqueId());
    }

    public Long getReceiveId() {
        return receiveId;
    }

    public void setReceiveId(Long receiveId) {
        this.receiveId = receiveId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getTemplateId() {
        return templateId;
    }

    public void setTemplateId(Long templateId) {
        this.templateId = templateId;
    }

    public String getCouponCode() {
        return couponCode;
    }

    public void setCouponCode(String couponCode) {
        this.couponCode = couponCode;
    }

    public Date getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(Date receiveTime) {
        this.receiveTime = receiveTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }


    @Override
    public String toString() {
        return "CouponReceive{" +
        ", receiveId=" + receiveId +
        ", userId=" + userId +
        ", templateId=" + templateId +
        ", couponCode=" + couponCode +
        ", receiveTime=" + receiveTime +
        ", status=" + status +
        ", createDate=" + createDate +
        ", updateDate=" + updateDate +
        "}";
    }
}
